Copyright: Copyright (c) 1995 Okino Computer Graphics, Inc.


3D Studio Geometry Import Converter
PolyTrans Import Plug-ins for 3DS MAX

This help file describes the 3DS MAX plug-in which allows 3DS MAX v1.2 and v2.x to import 3D files via the PolyTrans import converters.

Click here to learn how to import objects into 3DS MAX using the PolyTrans plug-in.

The following sections describe the options on the PolyTrans to 3DS MAX dialog box:

Mesh options

NURBS options

Bitmap Conversion options

Enables options

Animation options

Also, the mapping from the PolyTrans internal database to the 3DS MAX internal database is described by clicking here.

Copyright (c) 1988-1998 Okino Computer Graphics, Inc.

For updates please visit the Okino WEB site at http://www.okino.com or email to support@okino.com.


Import Conversion Process

The import process proceeds as follows:

1.	The user chooses File/Import from the 3DS MAX menu.

2.	The file selector dialog box appears.

3.	The user selects one of the import file formats shown in the following drop-down listbox:

4.	The user selects a file with the corresponding file format (such as car.slp if the SLP file format is chosen).

5.	The corresponding PolyTrans import converter DLL is loaded into memory and executed. An import options dialog box will appear from which you can set the options used to control the import of data.

6.	The scene data is loaded into the PolyTrans internal database.

7.	The PolyTrans to MAX dialog box (described elsewhere in this help file) options dialog box appears. These options control how the scene data will be imported into the 3DS MAX database from the PolyTrans database.

8.	The data will then be imported and converted from the PolyTrans database to the 3DS MAX database.


Bitmap Conversion Options
Bitmap Conversion Dialog Box Options:

This dialog box controls how referenced bitmap files will be handled during the import into 3DSMAX. The  three options are basically:

1.	Do not modify the bitmap filename reference and do not perform any bitmap conversion. This is useful if your bitmaps are already in a format recognized by 3D Studio MAX and the path to the bitmaps have been specified to 3DS MAX via its File/Configure Paths dialog box.

2.	Modify the extension of the bitmap filename to a bitmap format recognized by 3DSMAX, but do not perform any bitmap conversion. This option is useful if you have (1) either performed the bitmap conversions in a previous import process or (2) you wish to use an external program (such as PhotoShop) to perform the bitmap conversions.

3.	Perform bitmap conversion for those file formats not recognized by 3DSMAX and change the file extension of the bitmap. For example, if importing from a Lightwave scene file which references a bitmap called brick.iff (in the Amiga IFF file format), then this dialog box can enable the import converter to convert the Amiga IFF bitmap file to a 3DSMAX recognized file format such as TIFF.

No Bitmap Conversion or Bitmap Filename Changes (Radio Button)

If this radio button is chosen then any bitmap reference imported into 3DSMAX will not be changed, its filename extension wont be changed, the path to the bitmap will not be changed and no bitmap conversion will be done.

Convert all Bitmap File References To... (Radio Button)

Rather than convert referenced bitmap images to another file format this radio button (when selected) simply changes all the file extensions on bitmap files to a specific type. For example, if set to TIFF then all bitmap filenames imported into the 3DSMAX will be changed so that their file extensions end in .tif. This is a useful option is you already have all of the referenced texture maps converted to the desired file format (either from a previous invocation of this import converter or by using a batch bitmap conversion program).

Auto-Convert Bitmap Files to Another Format (Radio Button)

If this radio button is selected then all 2d bitmap textures which are currently defined and referenced by the internal NuGraf/PolyTrans database scene will be automatically tagged then converted to a new user-specified 2d bitmap file format. For example, if you are importing a Lightwave scene to 3DSMAX, and the Lightwave file references IFF bitmap files then this option can be enabled so that the IFF images get converted to TIFF format automatically.

If the bitmap texture(s) cannot be found in the location specified by the pathname prepended to the texture filename then the export converter will search for the texture(s) in all directories specified in the 3DSMAX Bitmaps file search paths (these can be modified by choosing the File/Configure Paths dialog box and clicking the Bitmaps tab).

Bitmap File Format (Combo Box)

This combo box lists the destination bitmap file format.

Bitmap Bits/Pixel: 2, 4, 8, 24 (Combo Box)

This combo lists determine the number of bits/pixel to write out to the new 2d bitmap file. The default is 24 bits. A color quantization algorithm will be used for the 2, 4 and 8 bits/pixel output formats. Not all bitmap file formats can accept 2-8 bits/pixel (in particular JPEG).

Dimensions: X = #, Y = #

These two drop-down list boxes determine the X and Y resolution for the converted bitmap file(s):

No Change	= Do not change the X or Y size (default)

Closest	= Use the next highest power-of-2 size

2, 4, 8, ... 256, 512	= Choose a specific size for the X or Y dimension

Confirm Potential Bitmap File Overwrites

If this checkbox is enabled (checkmarked) then the bitmap converter will confirm any potential overwrites of existing bitmap files on disk which have the same filename and extension as the one being written. If this option is disabled then no confirmation will be made.

Save Converted Bitmaps To...

These radio buttons determine where the new bitmap file will be written to. Note that enabling the Replace all Bitmap File Paths With This Path: option or the Strip File Paths From All Bitmap References option below will change the path prefix for the converted bitmap even though it was saved to disk in the location specified by one of these 3 radio buttons.

Directory Where Geometry Was Read From

The new bitmaps will be written to the directory where the original geometry file(s) were read from.

3D Studio MAX maps Directory

The new bitmaps will be written to the 3D Studio MAX maps directory.

Specific + Browse

The new bitmaps will be written to the directory specified by the text box. This directory can be changed by press the Browse button.

Strip File Paths From All Bitmap References

If this checkbox is check-marked then all bitmap file references will have their filename path removed from them. This is the default because 3DS MAX prefers to locate a bitmap file using the paths specified in its File/Configure Paths dialog box rather than having an absolute (and possible non-portable) absolute path specified for a bitmap file. For example, if a bitmap reference was original c:\myfiles\textures\brick.bmp then enabling this option will change the reference to brick.bmp. If this option is disabled then the filepath and filename to the bitmap reference will not be changed.

Replace all Bitmap File Paths With This Path:

This option allows all bitmap references imported into 3DSMAX to be prefixed with a new filepath. This might be useful, for example, if all of your bitmap files are located in one specific directory or if you wish to change the prefix on the imported bitmap references. This new path will override all other options on this bitmap conversion dialog box (in other words, it will replace a bitmaps file path regardless of any other file path added to the bitmap via other options in this dialog box). To choose the filepath press the Browse button. To disable this option, click on the checkbox again so that it comes un-checkmarked.


Mesh Conversion Options
Meshes Dialog Box Options:

When importing polygons, or NURBS surfaces converted to polygons, this dialog box specifies options relating to the import of the polygons.

Weld Adjacent Vertices Together

If this checkbox is enabled (check-marked) then a vertex welding operation will be applied to all polygon vertices. Vertex welding collapses adjacent vertices which are within a distance less than or equal to the threshold value specified on the dialog box This welding operation should be performed if the Assign Smoothing Groups to Mesh Objects option (see below) is enabled. Note that welding of vertices can only occur within a single object and not between different objects. This option is enabled by default so that the Assign Smoothing Groups option works as expected.

Maximum Distance Between Two Vertices

If the distance between two vertices is less than or equal to this number, and the Weld Adjacent Vertices Together checkbox is check-marked (enabled) then the two vertices will be collapsed (welded) into one.

Reverse Orientation of all Polygons and Flip Normals

If this checkbox is enabled (check-marked) then the orientation of all polygons will be reversed. You might want to enable this option if you are finding that the 3DSMAX renderer is displaying only the back-facing polygons rather than the front-facing polygons.

Make Polygon Orientations Consistent (Unify Normals)

For some 3d models,  in particular those created using Autodesks AutoCAD, there is no consistent orientation of the polygons; ie: some polygons of a surface are oriented clockwise (the geometric normal points inward) while the remaining polygons are oriented counterclockwise (the geometric normal points outward). This is a problem for the Assign Smoothing Groups to Mesh Objects option below since all of the polygons must have the same orientation in order for the smoothed vertex normals to be computed properly.

If this option is enabled (checkmarked) then a special algorithm will be used to walk over the polygon mesh and reorient each polygon. Note, however, that adjacent polygons MUST share the same vertices for this algorithm to work; you can ensure that the vertices are shared by enabling the Weld Adjacent Vertices Together option above.

Vertex Normal Assignment Method

These are important options for the successful import of smoothed polygon data into 3DSMAX. First it must be explained how 3DSMAX assigns normals to each polygon vertex. Two methods are provided internally:

1.	If one or more polygons share a single vertex, and the vertex normal is the same for all polygons, then 3DSMAX allows that single normal to be assigned to the vertex. We will call this an explicit normal since it will be explicitly assigned to the vertex by the import converter.

2.	If two or more polygons share a single vertex, and each polygon requires a different vertex normal, then 3DSMAX uses the concept of smoothing groups to allow different normals to be assigned to a single vertex (for example, the corner of a square box which requires 3 different vertex normals, all at 90 degrees from each other). Rather than explicitly assign the different  normals to the vertex, the import converter assigns one or more smoothing groups to the vertex. Thus, the original vertex normal(s) are lost (thrown away) and replaced with some numbers representing the assigned smoothing groups. At a later stage, during a rendering process, 3DSMAX will use the smoothing groups to recompute the one or more normals assigned to a single vertex. In this manner 3 different normals can be assigned to the corner of a box, for example. A side effect of using smoothing groups is that the vertex normals computed by 3DSMAX using the smoothing group algorithm may not be the same as the original vertex normals imported from the data file. There is currently no method around this problem.

Assign Smoothing Groups to Mesh Objects

If this checkbox is enabled then the import converter will automatically compute and assign smoothing groups to all polygons. This will ensure that the 3DSMAX renderer computes adequate vertex normals if none should exist prior to rendering. This option must be enabled if an object has creases in it where a single vertex can have two or more distinct vertex normals. This option should also be enabled when importing SLP and STL data; if not enabled then the data will appear to have ugly black marks on it after being rendered.

Force One Explicit Normal Per Mesh Vertex

If this checkbox is enabled then the import converter will always force a single vertex normal onto each vertex if one was specified in the imported data file, even if the vertex is known to have 2 or more distinct normals. For smooth surfaces this will probably provide good results. However, if the surface has creases or sharp corners then enabling this option will make all creases and sharp corners disappear - the reason for this is that creases and sharp corners require two or more distinct normals at each vertex, but enabling this option will only allow a single normal to be assigned. This option should also be assigned if the imported data looks faceted, even with the Weld Adjacent Vertices and Assign Smoothing Groups options enabled.


NURBS Options
NURBS Dialog Box Options:

This import converter allows pure NURBS data to be imported from various file formats, including SoftImage, IGES and Wavefront OBJ. Trim curves are also supported. The following dialog box controls how the NURBS surface are imported into 3DSMAX.

Convert NURBS Patches to Polygons

If this checkbox is enabled then all trimmed NURBS surfaces will be converted to polygon meshes prior to import into 3DSMAX. For 3DSMAX versions 2.0 and earlier, this is the default option since these versions cannot import trimmed NURBS data. If this checkbox is disabled then the pure and unmodified trimmed NURBS surfaces will be imported directly into 3DSMAX.

Reverse Orientation of Polygonalized NURBS Patches

If this checkbox is enabled then the orientation of all polygonzied NURBS surfaces will be reversed prior to import into 3DSMAX. This option should be enabled if only the back side of a NURBS object is visible when rendered with the 3DSMAX renderer (alternatively, you can get both sides to appear in a rendering by enabling the Force 2 Sided rendering option in 3DSMAX).

Surface Tolerance

Curve Tolerance

These sliders control the conversion of NURBS surfaces into polygons. The number of polygons used to approximate the true NURBS surface (or, its smoothness) is controlled by the Surface Tolerance slider. Lower values will make the surface smoother but at the expense of a longer tessellation time and more resultant polygons. This slider represents the maximum allowable distance (tolerance) between the true NURBS patch and the tessellated polygonal surface; it is measured as a percentage of an objects maximum bounding box size. For example, if a NURBS patch is being tessellated which is 10x10x10 units in size, and this slider is set to 0.2% then the resultant polygonalized surface will not deviate from the ideal NURBS surface by more than 0.02 units (2% of 10).

Also, the Curve Tolerance slider is used to control the smoothness of the NURBS trimming curves. Smaller values will make trimmed curve regions smoother, but again at the expense of a longer tessellation time and more resultant polygons. This slider represents the maximum allowable distance (tolerance) between the true NURBS curve and the tessellated polygonal curve; it is measured as a percentage of an objects maximum bounding box size (the object on which the curve lies). For example, if a NURBS patch is being tessellated which is 10x10x10 units in size, and this slider is set to 0.2% then the resultant polygonalized NURB curve will not deviate from the ideal NURBS curve by more than 0.02 units (2% of 10).


Enables Options
Enables Dialog Box Options:

These check boxes control what type of data will be imported into 3DSMAX from the PolyTrans database.

Triangle Mesh

If this option is enabled (checkmarked) then all mesh (polygon) geometry will be imported from the file into 3DSMAX. If disabled then all mesh geometry will be ignored.

Mesh Normals

If this option is enabled (checkmarked) then any vertex normals that are assigned to polygon vertices will be imported.

Texture Coordinates

If this option is enabled (checkmarked) then any (u,v) texture coordinates that are assigned to polygon vertices will be imported. If this option is not enabled then texture maps will not appear on the polygon surfaces.

NURBS Surfaces

If this option is enabled (checkmarked) then NURBS surfaces will be imported. If disabled then NURBS surfaces will be ignored.

NURBS Trim Curves

If this option is enabled (checkmarked) then trim curves will be assigned to their associated NURBS surfaces, if the curves exist. If disabled then no trim curves will be assigned to the NURBS surfaces.

Hierarchy & Keyframe 0 Data

If this option is enabled (checkmarked) then the hierarchical relationship of objects in the scene will be imported. This data will also use the scaling, rotation and translation data used by animation keyframe # 0.

Animation Data

If this option is enabled (checkmarked) then object and camera animation data which is currently contained within the internal database will be imported into 3DSMAX. If this option is grayed out then animation data can only be imported from PolyTrans via the .3ds file format.

Atmospherics & Backgrounds

If this option is enabled (checkmarked) then fog, mist and background color schemes will be imported into 3DSMAX. If disabled then these effects will be ignored.

Materials

If this option is enabled (checkmarked) then materials will be created and assigned to the geometric objects in the scene. If disabled then no materials will be created.

Bitmap References

If this option is enabled (checkmarked) then all 2D bitmap textures will be assigned to their associated materials. If this option is disabled then no bitmap references will be created and none will be assigned to the 3DS MAX materials (this basically disables texture mapping).

Cameras

If this option is enabled (checkmarked) then the parameters of the current default camera will be imported.

Lights

If this option is enabled (checkmarked) then ambient, point, directional and spot light sources will be imported.

Delete Unreferenced Materials

If this option is enabled (checkmarked) then all imported materials which are not referenced in any way (such as by a mesh or NURBS surface) will be deleted prior to import into 3DSMAX.

Enable Two-Sided Material Flag

If this option is enabled (checkmarked) then the 2-Sided flag associated with each 3DS MAX material definition will be enabled. This is the default. If the check-mark is disabled then then 2-Sided flag will be disabled in each 3DS MAX material.


Animation Conversion Options
Animation Dialog Box Options:

As the dialog box snapshot shows, animation data can only be converted by the stand-alone version of PolyTrans (or NuGraf). This is achieved using the following steps:

1.	Execute the stand-alone version of PolyTrans (or NuGraf) and use it to convert animation data to the .3ds file format (such as from Lightwave).

2.	Execute 3DS MAX and import the .3ds file. You must use the original .3ds import converter distributed with 3DSMAX and not the PolyTrans .3ds import converter!

In the near future this PolyTrans plug-in will directly support import of animation data.


Supported Parameter Conversions and Mappings
Supported Parameter Conversions and Mappings:

This section describes which PolyTrans database entities are imported into the 3DS MAX database:

Entities Yet to be Imported

The following PolyTrans entities are expected to be supported over time:

•	Hierarchy and animation. At the time of writing, PolyTrans supports animation and hierarchy conversion between 3D Studio r4 (.3ds), Lightwave, and DirectX (export only) using the stand-alone version of PolyTrans or NuGraf.

•	Trimmed NURBS. This should be supported by the MAX 2.5 release or thereafter. Currently all trimmed NURBS are converted to triangle meshes prior to import into 3DS MAX.

•	Planar and cubical environment maps. At the moment only spherical reflection maps are imported.

Polygon Geometry

All PolyTrans geometry, including n-sided polygon meshes with recursive holes, trimmed NURBS surfaces, bicubic patches and quadric surface will all be triangulated prior to import into 3DS MAX. The triangulation is necessary because triangle meshes are the core geometric primitive in 3DS MAX.

Please note that 3DS MAX internally is geared towards the usage of smoothing groups to make objects appear smooth whereas almost all other 3d modeling packages allow 1 or more vertex normals to be assigned to each polygon vertex. While 3DS MAX allows a single vertex normal to be assigned to a polygon vertex, it does not properly allow more than 1 vertex normal to be assigned to a single polygon vertex (multiple vertex normals are deleted prior to a rendering process and replaced with single normals computed from smoothing groups). This is a problem when importing meshed data that has very long and thin triangles, at obtuse angles, such as that from STL data. PolyTrans makes a good attempt to overcome the lack of multiple vertex normals by computing proper smoothing groups and toying with the vertex normals. It is hoped that future versions of MAX will provide a method to associate 2 or more vertex normals with a single polygon vertex.

The following PolyTrans object attributes will be imported along with the mesh geometry:

•	Vertex (u,v) texture coordinates

•	Casts Shadows flag

•	Receive Shadows flag

•	Hidden flag.

And these are the currently unsupported PolyTrans geometric attributes:

•	U/V tangent vectors are not imported. There is no equivalent in 3DS MAX.

•	Vertex colors are currently not imported.

In addition, the import plug-in allows the following geometric processing functions to be applied to the imported mesh geometry:

•	Flip orientation of all normals.

•	Unify the orientation of all polygons and normals.

•	Weld all vertex coordinates and vertex normals together using a specified tolerance.

NURBS Geometry

Import  of trimmed NURBS from PolyTrans will be supported in MAX 2.5. At this time all trimmed NURBS are converted to triangle meshes prior to import into 3DS MAX. Supported import file format that allows for trimmed NURBS are: IGES 5.3, Wavefront OBJ (good for importing from Rhino and Alias|Wavefront) and SoftImage.

Cameras

The following camera types and camera parameters are converted:

PolyTrans Camera Parameter	Imported 3DS MAX Parameter
Targeted camera	Targeted camera
Window width and height	Field of view

Lights

The following light types and light parameters are converted:

PolyTrans Camera Parameter	Imported 3DS MAX Parameter
Point light	Omni light
Targeted spot light	Targeted spot light
Directional light	Directional light
RGB color	Color
Enabled	On/Off
Intensity	Intensity
Diffuse Enabled	Affect Diffuse
Specular Enabled	Affect Specular
Shadow mapped shadows	Shadow mapped shadows
Ray traced shadows	Ray traced shadows
Delta angle (spot light)	Hot size (spot light)
Cut off angle (spot light)	Fall off (spot light)
Not converted	Use Atten + start + end
Not converted	Map bias
Not converted	Range
Not converted	Shadow map size
1.0	Aspect
0.0	Overshoot
TRUE	Use global

Materials

The following table describes how the PolyTrans material parameters are mapped to equivalent material parameters in 3DS MAX:

PolyTrans Material Parameter	Converted 3DS MAX Material Parameter
Ambient color and ambient coefficient	Depending on lock ambient flag, ambient coefficient multiplied by ambient color or the diffuse color.
Diffuse color and diffuse coefficient	Diffuse color multiplied by the diffuse shading coefficient.
Specular color and specular shading coefficient	Depending on lock specular flag, specular coefficient multiplied by soecular color or the diffuse color. If metal value < 0.2, and specular lock off, then specular color set to white.
Lock ambient + diffuse	Lock ambient + diffuse
Lock diffuse + specular	Lock diffuse + specular
Flat shading model	Constant shading model
Gouraud shading model	Phong shading model
Phong shading model	Phong shading model
Phong shading model with metal coefficient set > 0.9	Metal shading model
Dialog box option	2-sided
PolyTrans wireframe shader.	Not converted.
No equivalent.	Face map
Specular shading coefficient.	A reweighted shininess strength.
Phong power.	Mapped to a logarithmic equivalent.
Luminous shading coefficient.	Self-illumination
Face opacity.	Opacity
Reflect opacity.	No equivalent
No equivalent.	Soften flag
No equivalent	Inside/outside transparency
IOR (index of refraction)	IOR (index of refraction)
Pass-to-children flag	No equivalent
Blinn shading model	No equivalent
Compute fresnel reflections flag	No equivalent

Texture Maps

The following are the various PolyTrans texture modulation methods supported and their equivalent texture modulation method in 3DS MAX.

PolyTrans Texture Map	Imported 3DS MAX Texture Map
Ambient color texture map	Ambient map
Diffuse color texture map	Diffuse map
Specular color texture map	Specular map
Not converted	Shininess map (phong power)
Specular coefficient texture map	Shininess stength map
Luminous coefficient texture map	Self illumination map
Opacity texture map	Opacity map
Not converted	Filter color
Bump map	Bump map
Spherical reflection map	Reflection map
Not converted	Refraction map
As for the texture definition itself, the following 2d bitmap texture parameters are supported:

PolyTrans Texture Parameter	Imported 3DS MAX Texture Parameter
u & v repeat	u & v tiling
u & v offset (relative to lower left corner of texture map).	u & offset (relative to center of texture map).
u & v wrap flags	u & v tile flags
If one or more of the same type of PolyTrans texture maps (ie.: diffuse color) are assigned to the same material slot in 3DS MAX, then all the same texture maps are corralled together using a COMPOSITE texture shader. The mixing between the various texture maps of the composite shader is set via the mix values obtained from the PolyTrans multi-layer texture mapping system.